Exercise 1: Map wind turbines in Rogaland

Plot wind turbines from OSM.

Load libraries

Code
library(osmdata)
library(sf)
library(tmap)

Get data from OSM

Code
query <- opq(bbox = "Rogaland") |> 
   add_osm_feature(key = "generator:source", value = "wind")
data <-  osmdata_sf(query)

wind_turbines <- data$osm_points 

Interactive map

Code
tmap_mode("view")

tm_shape(wind_turbines) +
  tm_dots(col = "#0072B2")
Figure 1: Wind turbines in Rogaland (Norway)